TEMPLATE = app

#QT += qml quick widgets serialport sql
QT += qml quick widgets sql serialport
QMAKE_CFLAGS+= -ffunction-sections -fdata-sections
QMAKE_CXXFLAGS += -std=c++11 -ffunction-sections -fdata-sections
## -ffunction-sections 和 -fdata-sections 将每个函数或符号创建为一个sections，其中每个sections名与function或data名保持一致。
##如果没有这个选项，所有的函数都会编译到一个section上面，于是函数就不能被“剥离”。

QMAKE_LFLAGS+=-Wl,--gc-sections
##在链接阶段，-Wl,–gc-sections指示链接器去掉不用的section（其中-wl, 表示后面的参数 -gc-sections 传递给链接器），这样就能减少最终的可执行程序的大小了。

QMAKE_CFLAGS_RELEASE += -Wall -O3 # Release -O3
QMAKE_CXXFLAGS_RELEASE += -Wall -O3 # Release -O3

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

# Default rules for deployment.
TARGET=rescue21
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

SOURCES += \
    main.cpp \
    Communicate/ProtocolPC.cpp \
    Common/EpollFunc.cpp \
    Display/DisplayControl.cpp \
    Display/DisPlayContent.cpp \
    AttitudeEstimation/ImageDetect.cpp \
    HardWare/CamControl.cpp \
    Store/DataStoreManage.cpp \
    Common/Debug.cpp \
    HardWare/V4l2Device.cpp \
    HardWare/CamGainControl.cpp \
    Store/DataStore.cpp \
    Store/StatusStore.cpp \
    Communicate/CommBasePosix.cpp \
    Communicate/SerialPortPosix.cpp \
    Communicate/UDPSockPosix.cpp \
    Communicate/SerialPortQt.cpp \
    Communicate/UDPSockQt.cpp \
    Communicate/ProtocolBase.cpp \
    Communicate/ProtocolBasePosix.cpp \
    Communicate/CommBaseQt.cpp \
    Communicate/CommunicateQt.cpp \
    Communicate/CommunicatePosix.cpp \
    Display/OpenCVFrame.cpp \
    Common/FunctionTransfer.cpp \
    Common/UtilityTH.cpp \
    HardWare/TerminalControl.cpp \
    HardWare/VedioRecord.cpp \
    Communicate/CommEpollManage.cpp \
    HardWare/GpioLeds.cpp \
    HardWare/I2cUserspace.cpp \
    VPU/enc.c \
    VPU/fb.c \
    VPU/vpu.c \
    Communicate/ProtocolHuaNuo.cpp \
    Communicate/ProtocolPodXinWang.cpp

HEADERS += \
    Communicate/ProtocolPC.h \
    Common/EpollFunc.h \
    Display/DisplayControl.h \
    Display/DisPlayContent.h \
    AttitudeEstimation/ImageDetect.h \
    HardWare/CamControl.h \
    Store/DataStoreManage.h \
    Common/debug.h \
    HardWare/V4l2Device.h \
    HardWare/CamGainControl.h \
    Store/DataStore.h \
    Store/StatusStore.h \
    VPU/vpu_jpegtable.h \
    VPU/vpu.h \
    VPU/enc.h \
    Communicate/CommBasePosix.h \
    Communicate/CommBase.h \
    Communicate/SerialPortPosix.h \
    Communicate/UDPSockPosix.h \
    Communicate/SerialPortQt.h \
    Communicate/UDPSockQt.h \
    Communicate/CommBaseQt.h \
    Communicate/ProtocolBase.h \
    Communicate/ProtocolBasePosix.h \
    Communicate/ProtocolBaseQt.h \
    Communicate/Communicate.h \
    Display/OpenCVFrame.h \
    Common/FunctionTransfer.h \
    Common/UtilityTH.h \
    HardWare/TerminalControl.h \
    HardWare/VedioRecord.h \
    Communicate/CommEpollManage.h \
    HardWare/GpioLeds.h \
    HardWare/I2cUserspace.h \
    VPU/utils_vpu.h \
    VPU/fb.h \
    Communicate/ProtocolHuaNuo.h \
    Communicate/ProtocolPodXinWang.h


EXTRA_LIB = /opt/SDK/fsl-bsp4.1/imx6qsabresd/usr

INCLUDEPATH +=./AttitudeEstimation \
./Communicate\
./AttitudeEstimation\
./Display\
./Store\
./Common\
./HardWare\
./VPU\
$${EXTRA_LIB}/include\

#/opt/yogurt/i.MX6-PD15.3.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/include \
#/opt/yogurt/i.MX6-PD15.3.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/include/opencv \
#/opt/yogurt/i.MX6-PD15.3.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/include/opencv2 \


LIBS += $${EXTRA_LIB}/lib/libopencv* \
        $${EXTRA_LIB}/lib/libtbb.so.2    \
        $${EXTRA_LIB}/lib/libwebp.so.6 \
        $${EXTRA_LIB}/lib/libipu.so* \
        $${EXTRA_LIB}/lib/libvpu.so* \

#LIBS += /opt/yogurt/i.MX6-PD15.3.0/sysroots/cortexa9hf-vfp-neon-phytec-linux-gnueabi/usr/lib/libopencv*.so

FORMS +=

DISTFILES +=
